package com.robot.agent.client;

import com.robot.agent.client.impl.SmsClientImpl;
import entity.Sms;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author wuyunbin
 */
@Component
@FeignClient(value = "robot-tools", fallback = SmsClientImpl.class)
public interface SmsClient {

    /**
     * 检查验证码是否过期
     *
     * @param sms
     * @return
     */
    @RequestMapping(value = "sms/isCheckCodeExpire", method = RequestMethod.POST)
    boolean isCheckCodeExpire(@RequestBody Sms sms);

    /**
     * 检验验证码是否正确
     *
     * @param sms
     * @param checkCode
     * @return
     */
    @RequestMapping(value = "sms/isCorrectCheckCode/{checkCode}", method = RequestMethod.POST)
    boolean isCorrectCheckCode(@RequestBody Sms sms, @PathVariable String checkCode);

    /**
     * 删除验证码
     * @param sms
     */
    @RequestMapping(value = "sms/deleteCheckCode", method = RequestMethod.POST)
    void deleteCheckCode(@RequestBody Sms sms);
}
